﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>动态生成金字塔效果</title>
    <script language="javascript">
        //动态创建表格
        var s='<table width="100%" align="center" cellpadding="0" cellspacing="0"><tr><td align="center">★</td></tr>',x="★";
        for(var i=0;i<20;i++){
            s+='<tr><td align="center">'+(x=x+"★")+'</td></tr>'  //循环输出每行
        }
        document.write(s+"<\/table>")
    </script>
</head>
<body>

</body>
</html>